Skip to content

feat(fleet-queue): creation outbox pilot — durable enqueue, paced verified drainer (#3706) - #8198

Merged
dezren39 merged 1 commit into
mainfrom
queue/13263-3706-creation-outbox
Nov 10, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/13263-3706-creation-outbox

Conversation

@dezren39

@dezren39 dezren39 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Creation outbox — bounded pilot for #3706

Task 13263 (queue repo-health-code-pilot, lane code-y). Implements the bounded creation-outbox pilot Drew approved on 2026-11-04 per the task-8938 design delta on #3706. Fleet-wide rollout is explicitly out of scope.

What lands

  • crates/fleet-queue/src/creation_outbox.rs (new) — the pure core: payload hash (SHA-256 over canonical JSON), dedupe/conflict semantics, backoff (Retry-After wins; 30s base, 1h cap, jitter), circuit breaker (3 consecutive rate limits → 300s open), pacing constants (2s gap, 300/hour budget), body marker, metrics. The four acceptance trials run here as oracle-named tests against a fake creator.
  • turso_queue.rs — storage + broker API: creation_outbox table in the fleet-queue Turso DB (ensure_schema; UNIQUE(repo, dedup_key); due index) plus the persisted circuit row; verbs /outbox-enqueue, /outbox-claim, /outbox-resolve, /outbox-list, /outbox-metrics. An expired lease is claimed as uncertain — a crashed drainer's create may have landed, so it reconciles by marker before any re-create. done without a read-back-verified number/URL is refused.
  • client.rs — fleet queue outbox enqueue|list|metrics|claim|resolve|drain. The serial drainer submits through gh with the hidden marker <!-- fleet-outbox:<id> --> in the body and marks done only after read-back verifies marker + number. Ambiguous creates go uncertain, never blind-retry.
  • doc/fleet/creation-outbox.md — pilot doc: rules, the one-producer wiring (new-issue-creator-code-a), activation order, and trial status.

Trials (fake creator, in-tree)

cargo test -p fleet-queue creation_outbox — 13 tests, all passing:

  1. 50-item burst: all ids, serial drain in budget, every object read-back verified, no duplicate/loss.
  2. Kill/restart: leased row with a landed create reconciles by marker after lease expiry; exactly one object per key. (This trial caught a real defect in the first cut — expired leases were re-created blind — fixed in both the core and the SQL claim verb.)
  3. Forced 403 with Retry-After (honored exactly; circuit opens; nothing bypasses; delivery resumes) and without (exponential backoff).
  4. 2026-11-01 replay: empty success is never done without read-back; marker recovers the landed object; proven-absence re-creates exactly once.

Plus dedupe replay/conflict, read-back-failure → uncertain, backoff growth/cap, metrics depth/oldest-age, SHA-256 FIPS vectors.

Verification

  • cargo test -p fleet-queue --all-features: 162 + 2 passed.
  • cargo test --workspace (pkgs/fleet): all suites pass.
  • cargo fmt -p fleet-queue applied to the touched files only (pre-existing fmt drift in unrelated files left alone).

Not in this PR (follow-on, enqueued separately)

Refs #3706 · task 13263


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 10, 2026 19:49
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T19:49:28.445111Z
We couldn’t complete this review. Comment @codex review to try again.
0b5daf7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b26ba2b2-ab6a-4d64-a3d2-82eceec0db09
Commits

Reviewing files that changed from the base of the PR and between fef0288 and c567598.

Files selected for processing: 5

  • doc/fleet/creation-outbox.md
  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/creation_outbox.rs
  • pkgs/fleet/crates/fleet-queue/src/lib.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition labels Nov 10, 2026
@dezren39
dezren39 force-pushed the queue/13263-3706-creation-outbox branch from 0b5daf7 to c567598 Compare November 10, 2026 22:11
@dezren39
dezren39 merged commit 09e4038 into main Nov 10, 2026
1 of 7 checks passed
@dezren39
dezren39 deleted the queue/13263-3706-creation-outbox branch November 10, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition work/assigned Queue worker lifecycle state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant